When digital computers were first available, the amount of memory in a computer was very small. Consequently, the size of a computer program was also very small. The challenge of writing a good computer program was to squeeze as much functions as possible in the available memory, i.e., the code to implement each function should be as small as possible. As the amount of memory increases, there is no need to place a premium on reducing the size of computer programs. Instead, the challenge becomes developing methods to write large applications efficiently and free of bugs. It is found that making software "modular" goes a long way in meeting this challenge. This is because it is much easier to write many small programs (and integrate them in an appropriate manner) than to write one large program. This approach can be used by both the traditional procedural-oriented programming environment and the recent object-oriented programming environment.
In modular programming, a complex system is decomposed into several subsystems. Each subsystem is associated with a program module. The subsystem could itself be decomposed into lower level subsystems (which are associated with lower level program modules). Ideally, these program modules are independent modules that can communicate with other program modules. As a result, programming can be performed by a team of programmers, with each programmer taking care of a small number of program modules. Consequently, modular programming encourages team work. Further, it is comparatively easy to debug and maintain each program modules. This is because defective or unsatisfactory program modules could be isolated and modified while the rest of the system is either not affected or minimally affected.
In order to combine program modules into a large application, the modules must be able to communicate with each other. An important factor for using modular programming successfully is that communication between program modules are handled efficiently. If the communication is cumbersome, the modules would use much computer resource for communication (instead of performing useful work) and the programmers would spend much time in writing codes to handle program communication.